package com.itheima.HomeWork.zuoye2;


import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;

/*需求：
        1. 现有集合：ArrayList\<Integer>list = new ArrayList();
        2. 利用反射机制在这个泛型为Integer的ArrayList中存放一个String类型的对象。*/
public class ListClassDemo {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        ArrayList<Integer> list = new ArrayList();
        Method method = list.getClass().getMethod("add", Object.class);
         method.invoke(list, "😂😂😂😂");
        System.out.println(list);
    }
}
